/*
 * PopupGui.hpp
 *
 *  Created on: Nov 26, 2012
 *      Author: guillou
 */

#ifndef POPUPGUI_HPP_
#define POPUPGUI_HPP_

#include <PopupLibTypes.hpp>
#include <QString>

using namespace Popup;

namespace PopupGui
{
  typedef enum {
    POPUP_DIALOG_ID_LOGS,
    POPUP_DIALOG_ID_LOGIN,
    POPUP_DIALOG_ID_SETTINGS,
    POPUP_DIALOG_ID_TRANSFERS
  } DialogID;

  typedef enum {
    POPUP_RECVD_OOPS,
    POPUP_RECVD_MESSAGE,
    POPUP_RECVD_CANVASS,
    POPUP_RECVD_CANVASS_VOTE,
    POPUP_RECVD_FUCK_NOTIF,
    POPUP_RECVD_SUCK_NOTIF,
    POPUP_RECVD_LIKE_NOTIF,
    POPUP_RECVD_POETRY_NOTIF
  } ReceivedMsgType;

  typedef enum {
    POPUP_LEFT     = 0x01,
    POPUP_HCENTER  = 0x02,
    POPUP_RIGHT    = 0x04,
    POPUP_TOP      = 0x10,
    POPUP_VCENTER  = 0x20,
    POPUP_BOTTOM   = 0x40
  } PositionFlag;

  Q_DECLARE_FLAGS(Position, PositionFlag)

  typedef enum {
    POPUP_TRANSITION_FROM_RIGHT  = 0x01,
    POPUP_TRANSITION_FROM_LEFT   = 0x02,
    POPUP_TRANSITION_FROM_BOTTOM = 0x10,
    POPUP_TRANSITION_FROM_TOP    = 0x20
  } TransitionFlag;

  Q_DECLARE_FLAGS(Transition, TransitionFlag)

  inline ReceivedMsgType convertRateItemToRecvdMsgType(
      Popup::UserRateItem p_item)
  {
    switch(p_item)
    {
      case POPUP_RATE_FUCKYOU:
        return POPUP_RECVD_FUCK_NOTIF;
      case POPUP_RATE_DONTLIKE:
        return POPUP_RECVD_SUCK_NOTIF;
      case POPUP_RATE_LIKE:
        return POPUP_RECVD_LIKE_NOTIF;
      case POPUP_RATE_POETRY:
        return POPUP_RECVD_POETRY_NOTIF;
      case POPUP_RATE_UNKNOWN:
      default:
        return POPUP_RECVD_OOPS;
    }
  }

  struct PopupThreadSave
  {
    Popup::ThreadID ID;
    QString title;
    Popup::UserList users;
    QString text;
    bool isActive;
  };
}

#endif /* POPUPGUI_HPP_ */
